<!--
 * @Description: 其他出库退库申请列表
 * @Version: 2.0
 * @Autor: gaofang
 * @Date: 2020-04-11 18:29:13
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-07-30 11:28:25
-->
<template>
  <a-card :bordered="false" title>
    <!-- 搜索 -->
    <a-form v-bind="layout">
      <a-row>
        <!-- 制单日期 -->
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="制单日期" ref="sort" prop="sort">
            <a-range-picker
              style="width: 100%"
              v-model="searchForm.sort"
              @change="getRangeTime"
            />
          </a-form-model-item>
        </a-col>
        <!-- 单据号 -->
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="单据号">
            <a-select
              v-model="searchForm.document"
              showSearch
              style="width: 100%"
            >
              <a-select-option
                v-for="(item, index) in OrderList"
                :key="index"
                :value="item"
              >
                {{ item }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>

        <!-- 仓库名称 -->
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="仓库名称">
            <a-select
              v-model="searchForm.depotName"
              @change="changeDepotId"
              showSearch
              style="width: 100%"
            >
              <a-select-option
                v-for="item in storageList"
                :key="item.depotId"
                :value="item.depotNo + '|' + item.depotName"
                >{{ item.depotNo }} {{ item.depotName }}</a-select-option
              >
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="审核状态">
            <a-select v-model="searchForm.auditMark" style="width: 100%">
              <a-select-option
                v-for="item in auditMarkList"
                :key="item.value"
                :value="item.value"
                >{{ item.title }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="审核人" ref="inspector" prop="inspector">
            <a-select
              v-model="searchForm.userName"
              showSearch
              @change="getInspectorId"
              style="width: 100%"
            >
              <a-select-option
                v-for="item in inspectorList"
                :key="item.userId"
                :value="item.userId + '|' + item.workNo + '|' + item.userName"
              >
                {{ item.workNo }} {{ item.userName }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="源单单号">
            <a-select
              v-model="searchForm.sourceNumber"
              style="width: 100%"
              showSearch
            >
              <a-select-option
                v-for="(item, index) in SourceOrderList"
                :key="index"
                :value="item"
              >
                {{ item }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <!-- 存货名称 -->
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="存货名称">
            <a-select
              v-model="searchForm.inventoryName"
              @change="getInventoryInfo"
              showSearch
              style="width: 100%"
              @search="handleInventoryInfoSearch"
            >
              <a-select-option
                v-for="item in inventoryList"
                :key="item.inventoryId"
                :value="
                  item.inventoryId +
                  '|' +
                  item.inventoryNo +
                  '|' +
                  item.inventoryName +
                  '|' +
                  item.standardModel +
                  '|' +
                  item.unit
                "
              >
                {{ item.inventoryNo }} {{ item.inventoryName }}
                {{ item.standardModel }} {{ item.unit }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <!-- 所属单位 -->
        <!-- <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
          <a-form-model-item label="所属单位">
            <a-select
              @change="changestorageUnitId"
              v-model="searchForm.storageUnit"
              showSearch
              style="width: 100%"
            >
              <a-select-option
                v-for="item in storageList"
                :key="item.depotId"
                :value="item.depotNo + '|' + item.depotName"
                >{{ item.depotNo }} {{ item.depotName }}</a-select-option
              >
            </a-select>
          </a-form-model-item>
        </a-col> -->
        <a-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24"></a-col>

        <a-col
          :xl="8"
          :lg="8"
          :md="12"
          :sm="24"
          :xs="24"
          :style="{ textAlign: 'right' }"
        >
          <a-button type="primary" @click="Search()">查询</a-button>
          <a-button style="margin-left: 8px" @click="Reset()">重置</a-button>
        </a-col>
      </a-row>
    </a-form>

    <!-- 搜索下的表格 -->
    <a-table
      v-cloak
      :columns="columns"
      :data-source="dataSource"
      :pagination="pagination"
      @change="handleTableChange"
      style="margin-top: 20px"
      :scroll="{ x: 1600, y: 670 }"
      size="small"
    >
      <!-- 单据号 -->
      <span slot="document" slot-scope="text, record">
        <a @click="RouterJump(record)">{{ text }}</a>

        <!-- <a v-if="record.auditMark != 1" @click="RouterJump(record)">
          {{ text }}
        </a>
        <span v-if="record.auditMark == 1"> {{ text }} </span> -->
      </span>

      <template slot="options" slot-scope="text, record">
        <a-popconfirm
          ok-text="确定"
          cancel-text="取消"
          @confirm="Delete(record)"
        >
          <template slot="title">
            <p>确定删除？</p>
          </template>
          <a type="danger"> 删除 </a>
        </a-popconfirm>
      </template>
    </a-table>
  </a-card>
</template>
<script>
// import * as XLSX from "xlsx";

// import { openDownloadDialog, sheet2blob } from "@/utils/export.js";

import { CommonAjax } from "@/services/modules/common";
const comHttp = new CommonAjax(); // 公用接口
import { mapState, mapGetters } from "vuex"; //

const columns = [
  {
    title: "序号",
    dataIndex: "key",
    key: "key",
    align: "center",
    width: "50px",
  },
  {
    title: "单据日期",
    dataIndex: "documentDate",
    key: "documentDate",
    align: "center",
    width: "80px",
  },
  {
    title: "审核标志",
    dataIndex: "auditMark_dictText",
    key: "auditMark_dictText",
    align: "center",
    width: "80px",
  },
  //   {
  //     title: "记账标志",
  //     dataIndex: "bookkeepingMark_dictText",
  //     key: "bookkeepingMark_dictText",
  //     align: "center",
  //   },
  {
    title: "单据号",
    dataIndex: "document",
    key: "document",
    align: "center",
    width: "100px",
    scopedSlots: { customRender: "document" },
  },
  {
    //! 刚加的，没有
    title: "仓库编码",
    dataIndex: "storcode",
    key: "storcode",
    align: "center",
    width: "100px",
  },
  {
    title: "仓库名称",
    dataIndex: "storname",
    key: "storname",
    align: "center",
    width: "100px",
  },
  // {
  //   //! 刚加的，没有
  //   title: "所属仓库",
  //   dataIndex: "storageUnit_dictText",
  //   key: "storageUnit_dictText",
  //   align: "center",
  // },
  //   {
  //     title: "所属单位",
  //     dataIndex: "storageUnit_dictText",
  //     key: "storageUnit_dictText",
  //     align: "center",
  //   },
  {
    title: "存货编码",
    dataIndex: "invcode",
    key: "invcode",
    align: "center",
    width: "100px",
  },
  {
    title: "存货名称",
    dataIndex: "invname",
    key: "invname",
    align: "center",
    width: "100px",
  },
  {
    title: "规格型号",
    dataIndex: "specificationsModel",
    key: "specificationsModel",
    align: "center",
    width: "80px",
  },
  {
    title: "单位",
    dataIndex: "unit",
    key: "unit",
    align: "center",
    width: "50px",
  },
  {
    title: "辅助单位",
    dataIndex: "auxiliaryUnit",
    key: "auxiliaryUnit",
    align: "center",
    width: "50px",
  },
  {
    title: "数量",
    dataIndex: "quantity",
    key: "quantity",
    align: "center",
    width: "50px",
  },
  {
    title: "单价",
    dataIndex: "unitPrice",
    key: "unitPrice",
    align: "center",
    width: "50px",
  },

  {
    title: "金额",
    dataIndex: "originalCurrency",
    key: "originalCurrency",
    align: "center",
    width: "50px",
  },
  //   {
  //     title: "批次号",
  //     dataIndex: "batchNumber",
  //     key: "batchNumber",
  //     align: "center",
  //   },
  //   {
  //     title: "制单人",
  //     dataIndex: "singleProducer_dictText",
  //     key: "singleProducer_dictText",
  //     align: "center",
  //   },
  //   {
  //     title: "负责人",
  //     dataIndex: "responsiblePerson_dictText",
  //     key: "responsiblePerson_dictText",
  //     align: "center",
  //   },
  //   {
  //     title: "审核人",
  //     dataIndex: "inspector_dictText",
  //     key: "inspector_dictText",
  //     align: "center",
  //   },

  {
    title: "源单号单号", //源单号
    dataIndex: "sourceNumber",
    key: "sourceNumber",
    align: "center",
    width: "100px",
  },
  {
    title: "出菇领料金额",
    dataIndex: "amountOfFruitPicking",
    key: "amountOfFruitPicking",
    align: "center",
    width: "90px",
  },
  {
    //! 刚加的，还没交互
    title: "审核人",
    dataIndex: "inspector_dictText",
    key: "inspector_dictText",
    align: "center",
    width: "80px",
  },

  {
    title: "操作",
    dataIndex: "options",
    key: "options",
    align: "center",
    width: "80px",

    scopedSlots: { customRender: "options" },
  },
];

const rowSelection = {
  onChange: (selectedRowKeys, selectedRows) => {
    console.log(
      `selectedRowKeys: ${selectedRowKeys}`,
      "selectedRows: ",
      selectedRows
    );
  },
  onSelect: (record, selected, selectedRows) => {
    console.log(record, selected, selectedRows);
  },
  onSelectAll: (selected, selectedRows, changeRows) => {
    console.log(selected, selectedRows, changeRows);
  },
};

export default {
  data() {
    return {
      auditMarkList: [
        {
          value: 1,
          title: "已审核",
        },
        {
          value: 2,
          title: "未审核",
        },
      ],
      inspectorList: [], // 审核人

      // ---------- 分页使用 -------------
      pagination: {
        total: 0,
        current: 1,
        pageSize: 10, //每页中显示10条数据
        pageSizeOptions: ["10", "20", "30"], // 每页中显示的数据
        showTotal: (total) => `共有${total}条数据`, //分页中显示总的数据
        showSizeChanger: true, // 显示页面条数改变
        showQuickJumper: true, // 显示快速跳转
      },
      queryParam: {
        //查询参数
        page: 1, //第几页
        size: 10, //每页中显示数据的条数
        hosName: "",
        hosCode: "",
        province: "",
        city: "",
      },

      // 搜索栏布局
      layout: {
        labelCol: { span: 8 },
        wrapperCol: { span: 15 },
      },
      // 搜索列表
      searchForm: {
        auditMark: "",
        inspector: "",
        sourceNumber: "",
        document: "", // 单据号
        depotId: "", // 仓库id
        inventoryId: "", // 存货Id
        startTime: "",
        endTime: "",
        storageUnitId: "", // 所属单位Id
        deptId: "", //销售部门id

        depotName: undefined, // 仓库名称
        inventoryName: undefined, // 存货名称

        storageUnit: undefined, // 所属单位名称

        // dept: undefined, // 销售部门

        sort: null, // 时间段
      },

      // 销售出库订单列表
      columns,
      dataSource: [],
      rowSelection,
      SourceOrderList: [], //源单单号列表

      alreadyCheckTag: false, // 是否审核标志
      alreadyRecordTag: false, // 是否记账标志

      // 列表
      OrderList: [], // 订单列表，返回所有的销售出库单
      storageList: [], // 仓库
      goodsList: [], // 存货
      saleDepartmentList: [], // 销售部门
      ALLOrderList: [], // 所有的订单列表,存储订单单号
      inventoryList: [], // 存货列表
    };
  },
  computed: {
    // 获取本地数据
    ...mapState("user", { currUser: "info", currPost: "position" }),
    ...mapGetters({
      getDepsInfo: "user/getDepsInfo",
    }),
    // ...mapState("setting", ["isMobile"]),
  },
  mounted() {
    this.getInspectorList(); // 仓库审核人员
    this.getOutStorageApplyList();
    this.getStorageList(); // 仓库列表
    // this.getSaleDepartmentList(); // 获取销售部门
    this.getOrderList(); // 获取订单列表
    this.getSourceOrderList(); //获取生产领料单列表
  },
  watch: {
    // "$route.query.Id":"getParam"
    $route(to, from) {
      //监听路由是否变化
      console.log("to", to);
      console.log("from", from);
      // window.location.reload();
      this.getOutStorageApplyList(); //
      this.getOrderList(); // 获取订单列表
    },
  },
  methods: {
    // 仓库物品模糊查询,解决卡顿的问题
    handleInventoryInfoSearch(value) {
      value = value.replace(/\s*/g, ""); // 去掉空字符串
      if (value == "") {
        this.$message.error("请输入要搜索的物品名称");
      } else {
        this.inventoryList = [];
        let queryPath = "?name=" + value;
        comHttp.getSearchInventoryInformationFile(queryPath).then((res) => {
          console.log("res", res.result);
          for (let i = 0; i < res.result.length; i++) {
            let data = {
              inventoryId: res.result[i].pkInvbasdoc, // 存货 id
              inventoryName: res.result[i].invname,
              inventoryNo: res.result[i].invcode,
              standardModel: res.result[i].invspec,
              unit: res.result[i].measname,
            };
            this.inventoryList.push(data);
          }
        });
      }
    },
    // 获取存货id
    getInventoryInfo(value, option) {
      this.searchForm.inventoryId = option.key;
      console.log("存货id::::", this.searchForm.inventoryId);
    },

    // 审核人
    getInspectorList() {
      const roleName = "仓库审核人员";
      let queryPath = "?roleName=" + roleName;
      comHttp.getUserRoleNameByUserNameId(queryPath).then((res) => {
        for (let i = 0; i < res.result.length; i++) {
          let data = {
            userName: res.result[i].userName,
            userId: res.result[i].userId,
            workNo: res.result[i].workNo,
          };
          this.inspectorList.push(data);
        }
      });
    },
    // 获取审核人Id
    getInspectorId(value, options) {
      this.searchForm.inspector = options.key;
    },
    // 获取源单号列表
    getSourceOrderList() {
      let queryPath = "?string=QTSQ-";
      comHttp.getSourceNumber(queryPath).then((res) => {
        console.log("获取生产领料单源单列表:::::", res);
        for (let i = 0; i < res.result.length; i++) {
          this.SourceOrderList.push(res.result[i]);
        }
      });
    },

    // 获取基建出库列表  默认查询路径为第一页,
    getOutStorageApplyList(
      queryPath = "?pageNo=1&inOutCategoryIdentification=11&inOutIdentification=3" // 出入库类别标识，基建出库5，其他出库6:销售出库,出库2入库1
    ) {
      comHttp.getOutStorageApplyList(queryPath).then((res) => {
        this.dataSource = [];
        this.ALLOrderList = [];
        console.log("获取仓库列表", res);

        const pagination = { ...this.pagination };
        pagination.total = res.result.total;
        pagination.pageSize = res.result.size;
        pagination.current = res.result.current;
        this.pagination = pagination;

        //  this.dataSource=res.result.records;

        for (let i = 0; i < res.result.records.length; i++) {
          // console.log("11111111111111111111111");
          // let data=res.result.records[i];
          // delete data.document;

          let data = {
            id: res.result.records[i].id,
            key: (res.result.current - 1) * 10 + i + 1,
            documentDate: res.result.records[i].documentDate, // 单据日期
            auditMark_dictText: res.result.records[i].auditMark_dictText, // 审核标志
            auditMark: res.result.records[i].auditMark, // 审核标志
            bookkeepingMark: res.result.records[i].bookkeepingMark, // 记账标志
            bookkeepingMark_dictText:
              res.result.records[i].bookkeepingMark_dictText, // 记账标志
            storcode: res.result.records[i].storcode, // 仓库编码
            storname: res.result.records[i].storname, // 仓库名称
            // 客户
            // 业务员
            storageUnit_dictText: res.result.records[i].storageUnit_dictText, // 所属单位
            invcode: res.result.records[i].invcode, // 存货编码
            invname: res.result.records[i].invname, // 存货名称
            specificationsModel: res.result.records[i].invspec, // 规格型号
            unit: res.result.records[i].measname, // 单位
            auxiliaryUnit: res.result.records[i].auxiliaryUnit_dictText, // 辅助单位
            quantity: res.result.records[i].quantity, // 数量
            // unitPrice: res.result.records[i].unitPrice, // 单价
            // originalCurrency: res.result.records[i].originalCurrency,// 金额
            // 批次号
            // giveaway_dictText: res.result.records[i].giveaway_dictText, // 是否赠品
            batchNumber: res.result.records[i].batchNumber, // 批次号

            singleProducer_dictText:
              res.result.records[i].singleProducer_dictText, // 制单人
            singleProducer: res.result.records[i].singleProducer, // 制单人

            responsiblePerson_dictText:
              res.result.records[i].responsiblePerson_dictText, // 负责人
            inspector_dictText: res.result.records[i].inspector_dictText, // 审核人
            amountOfFruitPicking: res.result.records[i].amountOfFruitPicking, // 出菇领料金额
            inspector: res.result.records[i].inspector, // 审核人Id
            // 记账标志
            sourceNumber: res.result.records[i].sourceNumber, // 源单号
            sendReceiveType: res.result.records[i].sendReceiveType, // 收发类别
            sendReceiveType_dictText:
              res.result.records[i].sendReceiveType_dictText, // 收发类别

            projectsUnderConstruction_dictText:
              res.result.records[i].projectsUnderConstruction_dictText, // 在建项目
            // remark: res.result.records[i].remark, // 备注
          };

          // 如果所有订单列表中包含了该订单
          if (this.ALLOrderList.indexOf(res.result.records[i].document) > -1) {
            console.log("没有重复");
            this.dataSource.push(data);
          } else {
            console.log("已经重复");
            this.ALLOrderList.push(res.result.records[i].document);
            data[`document`] = res.result.records[i].document;
            this.dataSource.push(data);
          }
        }
      });
    },
    // 获取全局查询条件
    getQueryPath() {
      console.log(this.searchForm);
      let queryPath =
        "?pageNo=" +
        this.queryParam.page +
        "&pageSize=" +
        this.queryParam.size +
        "&inOutCategoryIdentification=11" +
        "&inOutIdentification=3" +
        "&document=" +
        this.searchForm.document + // 单据号
        "&depotId=" +
        this.searchForm.depotId + // 仓库名称
        "&inventoryId=" +
        this.searchForm.inventoryId + // 存货名称
        "&beginDate=" +
        this.searchForm.startTime + //
        "&endDate=" +
        this.searchForm.endTime + //
        // 所属单位
        "&deptId=" +
        this.searchForm.deptId + //
        "&auditMark=" +
        this.searchForm.auditMark + //
        "&inspector=" +
        this.searchForm.inspector + //
        "&sourceNumber=" +
        this.searchForm.sourceNumber; //
      // 销售部门

      //   "&document=" +
      //   this.searchForm.documentId +
      //   "&deptId=" +
      //   this.searchForm.deptId;

      // "&endDate=" +
      //   this.searchForm.endTime +
      //   "&beginDate=" +
      //   this.searchForm.startTime;
      return queryPath; // 返回的查询条件
    },

    // 重置当前页码及页码参数
    resetPagination() {
      this.pagination = {
        total: 0,
        current: 1,
        pageSize: 10, //每页中显示10条数据
        pageSizeOptions: ["10", "20", "30"], // 每页中显示的数据
        showTotal: (total) => `共有${total}条数据`, //分页中显示总的数据
        showSizeChanger: true, // 显示页面条数改变
        showQuickJumper: true, // 显示快速跳转
      };
      //查询参数
      this.queryParam = {
        page: 1, //第几页
        size: 10, //每页中显示数据的条数
        hosName: "",
        hosCode: "",
        province: "",
        city: "",
      };
    },

    // 分页函数
    handleTableChange(pagination) {
      this.pagination.current = pagination.current;
      this.pagination.pageSize = pagination.pageSize;
      this.queryParam.page = pagination.current;
      this.queryParam.size = pagination.pageSize;
      let queryPath = this.getQueryPath();
      this.getOutStorageApplyList(queryPath);
    },

    // 查询
    Search() {
      let queryPath = this.getQueryPath();
      this.getOutStorageApplyList(queryPath);
      console.log("查询条件为:::", queryPath);
    },

    // -------------- 完成 ---------------------
    // 路由跳转函数
    RouterJump(record) {
      console.log("record!!!!!!!!!!!", record);
      if (record.auditMark == 1) {
        // 已经审核
        this.alreadyCheckTag = false; // 不可审核
      } else if (record.auditMark == 2) {
        // 未审核
        this.alreadyCheckTag = true; // 可以审核
      }

      if (record.bookkeepingMark == 1) {
        // 已经记账
        this.alreadyRecordTag = false; // 不可记账
      } else if (record.bookkeepingMark == 2) {
        // 未记账
        this.alreadyRecordTag = true; // 可以记账
      }
      console.log("record", record);

      // 审核人
      if (record.inspector == this.$store.state.user.info.id) {
        console.log("这是审核人,能审核,能提交");
        this.$router.push({
          path: "otherOutCancelApplyDetail",
          query: {
            Id: record.id,
          },
        });
      } // 制单人
      else if (record.singleProducer == this.$store.state.user.info.id) {
        console.log("这是制单人,能修改");
        // 如果未审核，则能修改，审核过了则不能修改
        if (record.auditMark == 2) {
          this.$router.push({
            path: "otherOutCancelApply",
            query: {
              Id: record.id,
            },
          });
        } else {
          // 审核过了,不能修改
          this.$router.push({
            path: "otherOutCancelApplyDetail",
            query: {
              Id: record.id,
            },
          });
        }
      }

      // 其余人员
      else {
        console.log("这是其余人员,仅能查看，不能审核和提交");
        this.$router.push({
          path: "otherOutCancelApplyDetail",
          query: {
            Id: record.id,
          },
        });
      }
    },
    // 获取仓库列表
    getStorageList() {
      this.storageList = [];
      comHttp.getStorageName().then((res) => {
        for (let i = 0; i < res.result.length; i++) {
          let data = {
            depotName: res.result[i].storname, //仓库名称
            depotNo: res.result[i].storcode, //仓库编码
            depotId: res.result[i].pkStordoc, //id
          };
          this.storageList.push(data);
        }
      });
    },
    // 获取仓库编码
    changeDepotId(value, option) {
      this.searchForm.depotId = option.key;
    },

    // 获取存货id
    changeinventoryId(value, option) {
      this.searchForm.inventoryId = option.key;
      console.log("存货id::::", this.searchForm.inventoryId);
    },
    // 获取所属单位id
    changestorageUnitId(value, option) {
      this.searchForm.storageUnitId = option.key;
      console.log("所属单位id::::", this.searchForm.storageUnitId);
    },

    //获取部门id
    changedeptId(value, option) {
      this.searchForm.deptId = option.key;
      console.log("部门id::::", this.searchForm.deptId);
    },
    // 获取时间段
    getRangeTime(date, dateString) {
      this.searchForm.startTime = dateString[0];
      this.searchForm.endTime = dateString[1];
    },
    // 重置查询条件
    Reset() {
      this.searchForm = {
        auditMark: "",
        inspector: "",
        sourceNumber: "",
        document: "", // 单据号
        documentId: "", // 单据号id
        depotId: "", // 仓库id
        depotName: undefined, // 仓库名称
        inventoryName: undefined, // 存货名称
        inventoryId: "", // 存货Id
        storageUnit: undefined, // 所属单位名称
        storageUnitId: "", // 所属单位Id
        dept: undefined, // 销售部门
        deptId: "", //销售部门id

        sort: null, // 时间段
        startTime: "",
        endTime: "",
      };
      this.resetPagination();
      this.getOutStorageApplyList();
    },

    // 删除
    Delete(record) {
      comHttp.getturnrequestformdelete("?id=" + record.id).then((res) => {
        if (res && res.code === 200) {
          this.$message.success("删除成功");
          this.getOutStorageApplyList();
        } else {
          this.$message.error("删除失败");
        }
      });
    },

    // 根据仓库Id获取物品信息
    // getGoodSInfo(id) {
    //   this.goodsList = [];
    //   comHttp.getInventoryInformationByStorageId("?id=" + id).then((res) => {
    //     console.log("获取存货信息:::::", res);
    //     for (let i = 0; i < res.result.length; i++) {
    //       let data = {
    //         inventoryId: res.result[i].id, // 存货 id
    //         inventoryName: res.result[i].inventoryName,
    //         inventoryNo: res.result[i].inventoryNo,
    //       };
    //       this.goodsList.push(data);
    //     }
    //   });
    // },
    // 获取单据号列表
    getOrderList() {
      let queryPath = "?string=QTCKTS-";
      comHttp.getOrderListTuiKu(queryPath).then((res) => {
        console.log("获取基建出库列表:::::", res);
        for (let i = 0; i < res.result.length; i++) {
          this.OrderList.push(res.result[i]);
        }
      });
    },
  },
};
</script>
<style scoped lang="less">
.avatar-uploader > .ant-upload {
  width: 160px;
  height: 160px;
}
.ant-upload-select-picture-card i {
  font-size: 32px;
  color: #999;
}

.ant-upload-select-picture-card .ant-upload-text {
  margin-top: 8px;
  color: #666;
}
textarea {
  border: 0;
  border-radius: 5px;
  border: 1px #d9d9d9 solid;
  width: 100%;
  height: 100px;
  padding: 10px;
  resize: none;
}
#feng_kong_cuo_shi_1 {
  width: 700px;
}
</style>
